package com.cartoon.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.cartoon.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.CarttonLRYDirectoryModel;
import pic.PicLoadManager;

public class LRYCartoonDirectoryAdapter  extends BaseQuickAdapter<CarttonLRYDirectoryModel.DataBean.ChapterListBean, BaseViewHolder> {
    private String pic;

    public LRYCartoonDirectoryAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<CarttonLRYDirectoryModel.DataBean.ChapterListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CarttonLRYDirectoryModel.DataBean.ChapterListBean item) {
        TextView tv_name = helper.itemView.findViewById(R.id.tv_name);
        ImageView pig = helper.itemView.findViewById(R.id.iv_pig);
        tv_name.setText(item.getTitle());
        tv_name.setSelected(true);
        PicLoadManager.loadPicture(pic,pig);

//        if(item.getLocked()){
//            helper.setText(R.id.tv_vip,"目前试看，后续可能会开放免费观看");
//        }else {
//            helper.setText(R.id.tv_vip,"");
//        }
    }

    public void setPic(String lrypic) {
        this.pic =lrypic;
    }
}
